GXSetColorSetParts
You can use theGXSetColorSetParts
function to replace specified colors in a color set object.
void GXSetColorSetParts(gxColorSet target, long index, long oldCount, long newCount, const gxSetColor data[]);
target
- A reference to the color set object whose color values you want to modify.
index
- The first color value to replace. To replace the first color value in the color set, specify 1 for this parameter.
oldCount
- The number of color values to replace. Specify
gxSelectToEnd
to replace all color values in the color set including and beyondindex
.newCount
- The number of new color values to add; that is, the number of color values in the
data
array.data
- The array of color values to add to the color set.
DESCRIPTION
TheGXSetColorSetParts
function assigns the specified color values to the target color set, starting at the location specified byindex
after first removing the number of existing color values specified byoldCount
.This function does not accept the
gxSetToNil
constant for thedata
parameter. If you want to simply remove colors, pass 0 fornewCount
.The current implementation of QuickDraw GX restricts the number of colors in a color set to a maximum of 65,535.
SPECIAL CONSIDERATIONS
If you attempt to modify the color values of a color set object used by an onscreen view device, this function posts a colorSet_access_restricted warning.ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory colorSet_is_nil inconsistent_parameters (debugging version) index_is_less_than_zero (debugging version) count_is_less_than_zero (debugging version) number_of_colors_exceeds_implementation_limit Warnings index_out_of_range count_out_of_range colorSet_access_restricted (debugging version) SEE ALSO
To retrieve the entire array of color values from a color set object, use theGXGetColorSet
function, described on page 4-73. To replace the entire array of color values in a color set object, use theGXSetColorSet
function, described on page 4-74. To retrieve some of the color values in a color set object, use theGXGetColorSetParts
function, described in the previous section.The
gxSetColor
union is described on page 4-56.